<?php


class Ext_Singleton
{
    private static $_instance;
	 
	public static function getInstance($className)
	{
		$_classKey = strtolower($className);
		if(isset($_instance[$_classKey]))
		{
			$_class = $_instance[$_classKey];
			if(is_object($_class))
			{
				return $_class;
			}
		}

		$_class = new $className();
		$_instance[$_classKey] = $_class;
		
		return $_class;
	}
}
